//
//  CollectionView.h
//  Civacrm
//
//  Created by 王桂敏 on 2017/2/9.
//  Copyright © 2017年 王桂敏. All rights reserved.
//

#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, CollectionViewType) {
    CollectionViewType0,//
    CollectionViewType1,
    CollectionViewType2,
    CollectionViewType3//   首页icon
};
@class CollectionView;

@protocol CollectionViewDelegate <NSObject>
@optional

- (void)collectionView:(CollectionView *)collectionView
             didSelect:(NSInteger)index
                  type:(CollectionViewType)type;


@end

@interface CollectionView : UIView<UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>

@property (nonatomic,assign) id<CollectionViewDelegate> delegate;

@property (nonatomic,assign) CollectionViewType type;

@property (nonatomic,strong) UICollectionView *collectionView;

@property (nonatomic,strong) UICollectionViewFlowLayout *layout;

@property (nonatomic,strong) NSMutableArray *dataSource;

@property (nonatomic,assign) NSInteger selectIndex;

- (id)initViewWithType:(CollectionViewType)type
                 frame:(CGRect)frame;

@end
